using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DocsConverter.Core.PdfToImages.GhostscriptSharp
{
    /// <summary>
    /// Which pages to output
    /// </summary>
    public class GhostscriptPages
    {
        private bool _allPages = true;
        private int _start;
        private int _end;

        /// <summary>
        /// Output all pages avaialble in document
        /// </summary>
        public bool AllPages
        {
            set
            {
                this._start = -1;
                this._end = -1;
                this._allPages = true;
            }
            get
            {
                return this._allPages;
            }
        }

        /// <summary>
        /// Start output at this page (1 for page 1)
        /// </summary>
        public int Start
        {
            set
            {
                this._allPages = false;
                this._start = value;
            }
            get
            {
                return this._start;
            }
        }

        /// <summary>
        /// Page to stop output at
        /// </summary>
        public int End
        {
            set
            {
                this._allPages = false;
                this._end = value;
            }
            get
            {
                return this._end;
            }
        }
    }

    /// <summary>
    /// Output devices for GhostScript
    /// </summary>
    public enum GhostscriptDevices
    {
        UNDEFINED,
        png16m,
        pnggray,
        png256,
        png16,
        pngmono,
        pngalpha,
        jpeg,
        jpeggray,
        tiffgray,
        tiff12nc,
        tiff24nc,
        tiff32nc,
        tiffsep,
        tiffcrle,
        tiffg3,
        tiffg32d,
        tiffg4,
        tifflzw,
        tiffpack,
        faxg3,
        faxg32d,
        faxg4,
        bmpmono,
        bmpgray,
        bmpsep1,
        bmpsep8,
        bmp16,
        bmp256,
        bmp16m,
        bmp32b,
        pcxmono,
        pcxgray,
        pcx16,
        pcx256,
        pcx24b,
        pcxcmyk,
        psdcmyk,
        psdrgb,
        pdfwrite,
        pswrite,
        epswrite,
        pxlmono,
        pxlcolor
    }

    /// <summary>
    /// Output document physical dimensions
    /// </summary>
    public class GhostscriptPageSize
    {
        private GhostscriptPageSizes _fixed;
        private System.Drawing.Size _manual;

        /// <summary>
        /// Custom document size
        /// </summary>
        public System.Drawing.Size Manual
        {
            set
            {
                this._fixed = GhostscriptPageSizes.UNDEFINED;
                this._manual = value;
            }
            get
            {
                return this._manual;
            }
        }

        /// <summary>
        /// Standard paper size
        /// </summary>
        public GhostscriptPageSizes Native
        {
            set
            {
                this._fixed = value;
                this._manual = new System.Drawing.Size(0, 0);
            }
            get
            {
                return this._fixed;
            }
        }

    }

    /// <summary>
    /// Native page sizes
    /// </summary>
    /// <remarks>
    /// Missing 11x17 as enums can't start with a number, and I can't be bothered
    /// to add in logic to handle it - if you need it, do it yourself.
    /// </remarks>
    public enum GhostscriptPageSizes
    {
        UNDEFINED,
        ledger,
        legal,
        letter,
        lettersmall,
        archE,
        archD,
        archC,
        archB,
        archA,
        a0,
        a1,
        a2,
        a3,
        a4,
        a4small,
        a5,
        a6,
        a7,
        a8,
        a9,
        a10,
        isob0,
        isob1,
        isob2,
        isob3,
        isob4,
        isob5,
        isob6,
        c0,
        c1,
        c2,
        c3,
        c4,
        c5,
        c6,
        jisb0,
        jisb1,
        jisb2,
        jisb3,
        jisb4,
        jisb5,
        jisb6,
        b0,
        b1,
        b2,
        b3,
        b4,
        b5,
        flsa,
        flse,
        halfletter
    }

}
